package com.lcy.mybatis.generator.po;

import java.util.Date;

public class User {
    private Integer id;

    private String name;

    private String password;

    private Integer departmentId;

    private String email;

    private String emailPassword;

    private Integer adminId;

    private Date addTime;

    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String PASSWORD = "password";

    public static final String DEPARTMENT_ID = "department_id";

    public static final String EMAIL = "email";

    public static final String EMAIL_PASSWORD = "email_password";

    public static final String ADMIN_ID = "admin_id";

    public static final String ADD_TIME = "add_time";

    public static final String[] COLUMNS = {ID,NAME,PASSWORD,DEPARTMENT_ID,EMAIL,EMAIL_PASSWORD,ADMIN_ID,ADD_TIME};

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getEmailPassword() {
        return emailPassword;
    }

    public void setEmailPassword(String emailPassword) {
        this.emailPassword = emailPassword == null ? null : emailPassword.trim();
    }

    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public static boolean contains(String value) {
        if(value == null){
            return false;
        }
        for (String column:COLUMNS) {
            if(column.equals(value)){
                return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", password=").append(password);
        sb.append(", departmentId=").append(departmentId);
        sb.append(", email=").append(email);
        sb.append(", emailPassword=").append(emailPassword);
        sb.append(", adminId=").append(adminId);
        sb.append(", addTime=").append(addTime);
        sb.append(", ID=").append(ID);
        sb.append(", NAME=").append(NAME);
        sb.append(", PASSWORD=").append(PASSWORD);
        sb.append(", DEPARTMENT_ID=").append(DEPARTMENT_ID);
        sb.append(", EMAIL=").append(EMAIL);
        sb.append(", EMAIL_PASSWORD=").append(EMAIL_PASSWORD);
        sb.append(", ADMIN_ID=").append(ADMIN_ID);
        sb.append(", ADD_TIME=").append(ADD_TIME);
        sb.append(", COLUMNS=").append(COLUMNS);
        sb.append("]");
        return sb.toString();
    }
}